xxxxxxxxxximport seaborn as snsx
titanic=sns.load_dataset("titanic")xxxxxxxxxxtitanic.head()import plotly.express as pximport numpy as nppip install plotlyxxxxxxxxxxpx.scatter(data_frame=titanic,x="age",y="fare")xxxxxxxxxxQ2. Using the tips dataset in the Plotly library, plot a box plot using Plotly express.Q2. Using the tips dataset in the Plotly library, plot a box plot using Plotly express.
x
tips = sns.load_dataset('tips')x
tipsxxxxxxxxxxdf=px.data.tips()xxxxxxxxxxfig=px.box(df,y="total_bill")fig.show()xxxxxxxxxxQ3. Using the tips dataset in the Plotly library, Plot a histogram for x= "sex" and y="total_bill" column inthe tips dataset. Also, use the "smoker" column with the pattern_shape parameter and the "day"column with the color parameter.Q3. Using the tips dataset in the Plotly library, Plot a histogram for x= "sex" and y="total_bill" column in the tips dataset. Also, use the "smoker" column with the pattern_shape parameter and the "day" column with the color parameter.
xxxxxxxxxximport plotly.express as pxdf=px.data.tips()fig=px.histogram(df,x="sex",y="total_bill",color="day",pattern_shape="smoker")fig.show()xxxxxxxxxxQ4. Using the iris dataset in the Plotly library, Plot a scatter matrix plot, using the "species" column forthe color parameter.Note: Use "sepal_length", "sepal_width", "petal_length", "petal_width" columns only with thedimensions parameter.Q4. Using the iris dataset in the Plotly library, Plot a scatter matrix plot, using the "species" column for the color parameter. Note: Use "sepal_length", "sepal_width", "petal_length", "petal_width" columns only with the dimensions parameter.
import plotly.express as pxdf = px.data.iris()fig=px.scatter_matrix(df,dimensions=["sepal_length","sepal_width","petal_length","petal_width"], color="species")fig.show()xxxxxxxxxxQ5. What is Distplot? Using Plotly express, plot a distplot.Q5. What is Distplot? Using Plotly express, plot a distplot.
xxxxxxxxxxThe displot figure factory display a combination of statistical representing of numerical data,such as histogram,kernel density estimation or normal curve,and rug plot.The displot can composed of all or any combination of the following 3 components:-a)histogramb)curvec)rug plotThe displot figure factory display a combination of statistical representing of numerical data,such as histogram,kernel density estimation or normal curve,and rug plot.
The displot can composed of all or any combination of the following 3 components:- a)histogram b)curve c)rug plot
xxxxxxxxxximport plotly.figure_factory as ffx=np.random.randn(1000)hist_data=[x]group_labels=['distplot']fig=ff.create_distplot(hist_data,group_labels)fig.show()